320 PART 6 Analyzing Survival Data
Don’t worry if the preceding paragraph makes your head spin. It is only meant to
give you a general sense behind the calculations in the log-rank test.
Running the log-rank test on software
Most commercial statistical software packages (like those described in Chapter 4)
can perform a log-rank test. You first organize your data into a table that has one
row per individual, and these three columns:»
» Group: The group variable contains a code indicating the individual’s group. In
this example, we could use the code Drug = 1 and Control = 2.»
» Time: A numerical variable containing the individual’s survival time. For
individuals experiencing the event during the study, it represents time to
event. For censored individuals, it is time to the end of observation.»
» Event status: A variable that indicates the individual’s status at the end of
observation. If they got the event, it is usually coded as 1, and if not or they
are censored, it is coded as 0.
To run the log-rank test, you tell your computer program which variable repre-
sents the group variable, which one means time, and which one contains the
event status. The program should produce a p value for the log-rank test. If you
set α = 0.05 and the p value is less than that, you reject the null and conclude that
the two groups have statistically significantly different survival curves.
In addition to the p value, the program may output median survival time for each
group along with confidence intervals, and difference in median times between
groups. If possible, you will also want to request graphs that show whether your
data are consistent with the hazard proportionality assumption that we describe
later in “Assessing the assumptions.”
Looking at the calculations
The log-rank test should not be done manually because it is an error-prone task.
But we believe you’ll have a better appreciation of the log-rank test if you under-
stand how it works, so we describe how the calculations could theoretically be
carried out using a Microsoft Excel spreadsheet.
The log-rank test utilizes information from the life tables needed to produce the
graph shown earlier in Figure 22-1. Figure 22-2 shows a portion of the life tables
that produced the curves shown in Figure 22-1, with the data for the two groups
displayed side by side.